<?php if(Yii::app()->user->hasFlash('registration')) { ?>
	<div class="success">
		<?php echo Yii::app()->user->getFlash('registration'); ?>
	</div>
<?php } ?>

<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'                   => 'registration-form',
	'enableAjaxValidation' => true,
	'clientOptions'        => array('validateOnChange' => true),
	'htmlOptions'          => array('enctype' => 'multipart/form-data'),
)); ?>

	<p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
	
	<?php echo $form->errorSummary(array($model)); ?>
	
	<div class="row">
		<?php echo $form->error($model, 'email'); ?>
		<?php echo $form->textField($model, 'email'); ?>
		<?php echo $form->labelEx($model, 'email'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->error($model, 'verifyEmail'); ?>
		<?php echo $form->textField($model, 'verifyEmail'); ?>
		<?php echo $form->labelEx($model, 'verifyEmail'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->error($model, 'password'); ?>
		<?php echo $form->passwordField($model, 'password'); ?>
		<?php echo $form->labelEx($model, 'password'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->error($model, 'verifyPassword'); ?>
		<?php echo $form->passwordField($model, 'verifyPassword'); ?>
		<?php echo $form->labelEx($model, 'verifyPassword'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->error($model, 'alias'); ?>
		<?php echo $form->textField($model, 'alias'); ?>
		<?php echo $form->labelEx($model, 'alias'); ?>
	</div>
	
	<?php if (UserModule::doCaptcha('registration')) { ?>
	<div class="row">
		<?php echo $form->error($model,'verifyCode'); ?>
		<?php echo $form->textField($model,'verifyCode'); ?>
		<?php echo $form->labelEx($model,'verifyCode'); ?>
		<div>
			<?php $this->widget('CCaptcha'); ?>
		</div>
		<p class="hint">
			<?php echo UserModule::t('Please enter the letters as they are shown in the image above.'); ?><br/>
			<?php echo UserModule::t('Letters are not case-sensitive.'); ?>
		</p>
	</div>
	<?php } ?>
	
	<div class="row submit">
		<?php echo CHtml::submitButton(UserModule::t('Register')); ?>
	</div>

<?php $this->endWidget(); ?>
</div>